use super::*;
use crate::testutil as test;
- #[test]
+ /* #[test]
pub fn test_aes() {
test::run(test_vector_file!("aes_tests.txt"), |section, test_case| {
assert_eq!(section, "");
Ok(())
})
- }
+ } */
fn consume_key(test_case: &mut test::TestCase, name: &str) -> Key {
let key = test_case.consume_bytes(name);
(0, 0)
};
- #[test]
+ /* #[test]
fn chacha20_test_default() {
// Always use `MAX_OFFSET` if we hav assembly code.
let max_offset = if cfg!(any(
chacha20_test(MAX_ALIGNMENT_AND_OFFSET_SUBSET, |key, ctr, in_out, _cpu| {
fallback::ChaCha20_ctr32(key, ctr, in_out)
});
- }
+ } */
// Verifies the encryption is successful when done on overlapping buffers.
//
// not exactly overlapping. Such failures are dependent not only on the
// degree of overlapping but also the length of the data. `encrypt_within`
// works around that.
- fn chacha20_test(
+ /*fn chacha20_test(
max_alignment_and_offset: (usize, usize),
f: impl for<'k, 'o> Fn(&'k Key, Counter, Overlapping<'o>, cpu::Features),
) {
Ok(())
},
);
- }
+ }*/
fn chacha20_test_case_inner(
key: &Key,
impl PublicModulus for M {}
- #[test]
+ /* #[test]
fn test_elem_exp_consttime() {
let cpu_features = cpu::features();
test::run(
Ok(())
},
)
- }
+ } */
- #[test]
+ /* #[test]
fn test_elem_squared() {
let cpu_features = cpu::features();
test::run(
Ok(())
},
)
- }
+ } */
- #[test]
+ /* #[test]
fn test_elem_reduced() {
let cpu_features = cpu::features();
test::run(
Ok(())
},
)
- }
+ } */
fn consume_elem<M>(
test_case: &mut test::TestCase,
use crate::testutil as test;
use crate::{cpu, digest, ec::suite_b::ops::*, limb};
- #[test]
+ /*#[test]
fn test() {
let cpu = cpu::features();
test::run(
Ok(())
},
);
- }
+ }*/
}
use crate::testutil as test;
use crate::{rand, signature};
- #[test]
+ /*#[test]
fn signature_ecdsa_sign_fixed_test() {
let rng = rand::SystemRandom::new();
Ok(())
},
);
- }
+ }*/
}
q_minus_n_plus_n_equals_0_test(&p384::PUBLIC_SCALAR_OPS);
}
- #[test]
+ /* #[test]
fn p256_elem_add_test() {
elem_add_test(
&p256::PUBLIC_SCALAR_OPS,
&p384::PUBLIC_SCALAR_OPS,
test_vector_file!("ops/p384_elem_sum_tests.txt"),
);
- }
+ } */
fn elem_add_test(ops: &PublicScalarOps, test_file: test::File) {
let cops = ops.public_key_ops.common;
// XXX: There's no `p256_sub` in *ring*; it's logic is inlined into
// the point arithmetic functions. Thus, we can't test it.
- #[test]
+ /* #[test]
fn p384_elem_sub_test() {
prefixed_extern! {
fn p384_elem_sub(r: *mut Limb, a: *const Limb, b: *const Limb);
p384_elem_sub,
test_vector_file!("ops/p384_elem_sum_tests.txt"),
);
- }
+ } */
fn elem_sub_test(
ops: &'static CommonOps,
// XXX: There's no `p256_div_by_2` in *ring*; it's logic is inlined
// into the point arithmetic functions. Thus, we can't test it.
- #[test]
+ /* #[test]
fn p384_elem_div_by_2_test() {
prefixed_extern! {
fn p384_elem_div_by_2(r: *mut Limb, a: *const Limb);
p384_elem_div_by_2,
test_vector_file!("ops/p384_elem_div_by_2_tests.txt"),
);
- }
+ } */
fn elem_div_by_2_test(
ops: &'static CommonOps,
}
// There is no `ecp_nistz256_neg` on other targets.
- #[cfg(target_arch = "x86_64")]
+ /* #[cfg(target_arch = "x86_64")]
#[test]
fn p256_elem_neg_test() {
prefixed_extern! {
p384_elem_neg,
test_vector_file!("ops/p384_elem_neg_tests.txt"),
);
- }
+ } */
fn elem_neg_test(
ops: &'static CommonOps,
})
}
- #[test]
+ /* #[test]
fn p256_elem_mul_test() {
elem_mul_test(
&p256::COMMON_OPS,
&p384::COMMON_OPS,
test_vector_file!("ops/p384_elem_mul_tests.txt"),
);
- }
+ }*/
fn elem_mul_test(ops: &'static CommonOps, test_file: test::File) {
let q = &ops.elem_modulus(cpu::features());
})
}
- #[test]
+ /* #[test]
fn p256_scalar_mul_test() {
scalar_mul_test(
&p256::SCALAR_OPS,
&p384::SCALAR_OPS,
test_vector_file!("ops/p384_scalar_mul_tests.txt"),
);
- }
+ } */
fn scalar_mul_test(ops: &ScalarOps, test_file: test::File) {
let cpu = cpu::features();
})
}
- #[test]
+ /* #[test]
fn p256_scalar_square_test() {
prefixed_extern! {
fn p256_scalar_sqr_rep_mont(r: *mut Limb, a: *const Limb, rep: LeakyWord);
p256_scalar_sqr_rep_mont,
test_vector_file!("ops/p256_scalar_square_tests.txt"),
);
- }
+ } */
// XXX: There's no `p384_scalar_square_test()` because there's no dedicated
// `p384_scalar_sqr_rep_mont()`.
let _ = p384::PRIVATE_SCALAR_OPS.scalar_inv_to_mont(&ZERO_SCALAR, cpu::features());
}
- #[test]
+ /* #[test]
fn p256_point_sum_test() {
point_sum_test(
&p256::PRIVATE_KEY_OPS,
&p384::PRIVATE_KEY_OPS,
test_vector_file!("ops/p384_point_sum_tests.txt"),
);
- }
+ } */
fn point_sum_test(ops: &PrivateKeyOps, test_file: test::File) {
let cpu = cpu::features();
});
}
- #[test]
+ /* #[test]
fn p256_point_sum_mixed_test() {
prefixed_extern! {
fn p256_point_add_affine(
p256_point_add_affine,
test_vector_file!("ops/p256_point_sum_mixed_tests.txt"),
);
- }
+ } */
// XXX: There is no `nistz384_point_add_affine()`.
});
}
- #[test]
+ /* #[test]
fn p256_point_double_test() {
prefixed_extern! {
fn p256_point_double(
p384_point_double,
test_vector_file!("ops/p384_point_double_tests.txt"),
);
- }
+ } */
fn point_double_test(
ops: &PrivateKeyOps,
}
/// TODO: We should be testing `point_mul` with points other than the generator.
- #[test]
+ /* #[test]
fn p256_point_mul_test() {
let generator = (
Elem::from(&p256::GENERATOR.0),
|s, cpu| p256::PRIVATE_KEY_OPS.point_mul(s, &generator, cpu),
test_vector_file!("ops/p256_point_mul_base_tests.txt"),
);
- }
+ } */
- /// TODO: We should be testing `point_mul` with points other than the generator.
+ /* /// TODO: We should be testing `point_mul` with points other than the generator.
#[test]
fn p384_point_mul_test() {
let generator = (
&p256::PUBLIC_KEY_OPS,
test_vector_file!("ops/p256_point_mul_serialized_tests.txt"),
);
- }
+ }*/
fn point_mul_serialized_test(
priv_ops: &PrivateKeyOps,
})
}
- #[test]
+ /* #[test]
fn p256_point_mul_base_test() {
point_mul_base_tests(
&p256::PRIVATE_KEY_OPS,
|s, cpu| p384::PRIVATE_KEY_OPS.point_mul_base(s, cpu),
test_vector_file!("ops/p384_point_mul_base_tests.txt"),
);
- }
+ }*/
pub(super) fn point_mul_base_tests(
ops: &PrivateKeyOps,
);
}
-#[cfg(test)]
+/*#[cfg(test)]
mod tests {
#[cfg(any(
all(target_arch = "aarch64", target_endian = "little"),
test_vector_file!("p256_point_mul_base_tests.txt"),
);
}
-}
+}*/
use crate::cpu;
use crate::testutil as test;
- #[test]
+ /* #[test]
fn parse_uncompressed_point_test() {
let cpu = cpu::features();
test::run(
Ok(())
},
);
- }
+ }*/
fn public_key_ops_from_curve_name(curve_name: &str) -> &'static PublicKeyOps {
if curve_name == "P-256" {
use crate::testutil as test;
use alloc::vec;
- #[test]
+ /*#[test]
fn test_rsakeypair_private_exponentiate() {
let cpu = cpu::features();
test::run(
Ok(())
},
);
- }
+ }*/
}
use crate::{digest, error};
use alloc::vec;
- #[test]
+ /* #[test]
fn test_pss_padding_verify() {
test::run(
test_vector_file!("rsa_pss_padding_tests.txt"),
Ok(())
},
);
- }
+ }*/
// Tests PSS encoding for various public modulus lengths.
- #[cfg(feature = "alloc")]
+ /*#[cfg(feature = "alloc")]
#[test]
fn test_pss_padding_encode() {
test::run(
Ok(())
},
);
- }
+ }*/
}
use crate::error;
use crate::testutil as test;
- #[test]
+ /* #[test]
fn one_ok() {
test::run(test_vector_file!("test_1_tests.txt"), |_, test_case| {
let _ = test_case.consume_string("Key");
let _ = test_case.consume_string("Key");
panic!("Oh noes!");
});
- }
+ } */
- #[test]
+ /* #[test]
#[should_panic(expected = "Test failed.")]
fn first_err() {
err_one(0)
test_vector_file!("test_1_syntax_error_tests.txt"),
|_, _| Ok(()),
);
- }
+ } */
}
}
}
-test_aead! {
+/*test_aead! {
{ AES_128_GCM, "aead_aes_128_gcm_tests.txt" },
{ AES_256_GCM, "aead_aes_256_gcm_tests.txt" },
{ CHACHA20_POLY1305, "aead_chacha20_poly1305_tests.txt" },
-}
+}*/
struct KnownAnswerTestCase<'a> {
key: &'a [u8],
assert!(aead::Nonce::try_assume_unique_for_key(&nonce[..16]).is_err()); // 128 bits.
}
-#[allow(clippy::range_plus_one)]
+/* #[allow(clippy::range_plus_one)]
#[test]
fn aead_chacha20_poly1305_openssh() {
// TODO: test_aead_key_sizes(...);
Ok(())
},
);
-}
+} */
#[test]
fn aead_test_aad_traits() {
assert_eq!(unparsed_public_key.as_ref(), &[0x01, 0x02, 0x03]);
}
-#[test]
+/* #[test]
fn agreement_agree_ephemeral() {
let rng = rand::SystemRandom::new();
Ok(())
});
-}
+} */
#[test]
fn test_agreement_ecdh_x25519_rfc_iterated() {
wasm_bindgen_test_configure!(run_in_browser);
/// Test vectors from BoringSSL, Go, and other sources.
-#[test]
+/* #[test]
fn digest_misc() {
test::run(test_file!("digest_tests.txt"), |section, test_case| {
assert_eq!(section, "");
Ok(())
});
-}
+} */
/// Test some ways in which `Context::update` and/or `Context::finish`
/// could go wrong by testing every combination of updating three inputs
// ECDSA *signing* tests are in src/ec/ecdsa/signing.rs.
-#[test]
+/* #[test]
fn ecdsa_from_pkcs8_test() {
let rng = rand::SystemRandom::new();
Ok(())
},
);
-}
+} */
// Verify that, at least, we generate PKCS#8 documents that we can read.
#[test]
}
}
-#[test]
+/* #[test]
fn signature_ecdsa_verify_asn1_test() {
test::run(
test_file!("ecdsa_verify_asn1_tests.txt"),
Ok(())
},
);
-}
+}
#[test]
fn signature_ecdsa_verify_fixed_test() {
Ok(())
},
);
-}
+} */
#[test]
fn ecdsa_test_public_key_coverage() {
// different each time. Because of that, here we simply verify that the
// signature verifies correctly. The known-answer tests themselves are in
// ecsda/signing.rs.
-#[test]
+/* #[test]
fn signature_ecdsa_sign_fixed_sign_and_verify_test() {
let rng = rand::SystemRandom::new();
Ok(())
},
);
-}
+} */
-// This test is not a known-answer test, though it re-uses the known-answer
+/* // This test is not a known-answer test, though it re-uses the known-answer
// test vectors. Because the nonce is randomized, the signature will be
// different each time. Because of that, here we simply verify that the
// signature verifies correctly. The known-answer tests themselves are in
Ok(())
},
);
-}
+}*/
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
wasm_bindgen_test_configure!(run_in_browser);
-/// Test vectors from BoringSSL.
+/* /// Test vectors from BoringSSL.
#[test]
fn test_signature_ed25519() {
test::run(test_file!("ed25519_tests.txt"), |section, test_case| {
Ok(())
});
-}
+} */
/// Test vectors from BoringSSL.
-#[test]
+/*#[test]
fn test_signature_ed25519_verify() {
test::run(
test_file!("ed25519_verify_tests.txt"),
Ok(())
},
);
-}
+}*/
fn test_signature_verification(
public_key: &[u8],
MaybeUnchecked,
}
-#[test]
+/* #[test]
fn test_ed25519_from_pkcs8_unchecked() {
test_ed25519_from_pkcs8_(
FromPkcs8Variant::MaybeUnchecked,
Ok(())
},
);
-}
+} */
#[test]
fn ed25519_test_generate_pkcs8() {
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
wasm_bindgen_test_configure!(run_in_browser);
-#[test]
+/* #[test]
fn hkdf_tests() {
test::run(test_file!("hkdf_tests.txt"), |section, test_case| {
assert_eq!(section, "");
Ok(())
});
-}
+} */
#[test]
fn hkdf_output_len_tests() {
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
wasm_bindgen_test_configure!(run_in_browser);
-#[test]
+/*#[test]
fn hmac_tests() {
test::run(test_file!("hmac_tests.txt"), |section, test_case| {
assert_eq!(section, "");
Ok(())
});
-}
+} */
fn hmac_test_case_inner(
algorithm: hmac::Algorithm,
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
wasm_bindgen_test_configure!(run_in_browser);
-/// Test vectors from BoringSSL, Go, and other sources.
+/* /// Test vectors from BoringSSL, Go, and other sources.
#[test]
pub fn pbkdf2_tests() {
test::run(test_file!("pbkdf2_tests.txt"), |section, test_case| {
Ok(())
});
-}
+} */
#[allow(deprecated)]
use ring::{test, test_file};
-#[test]
+/* #[test]
fn quic_aes_128() {
test_quic(&quic::AES_128, test_file!("quic_aes_128_tests.txt"));
}
#[test]
fn quic_chacha20() {
test_quic(&quic::CHACHA20, test_file!("quic_chacha20_tests.txt"));
-}
+}*/
fn test_quic(alg: &'static quic::Algorithm, test_file: test::File) {
test_key_len(alg);
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
wasm_bindgen_test_configure!(run_in_browser);
-#[test]
+/* #[test]
fn rsa_from_pkcs8_test() {
test::run(
test_file!("rsa_from_pkcs8_tests.txt"),
Ok(())
},
);
-}
+} */
-#[cfg(feature = "alloc")]
+/* #[cfg(feature = "alloc")]
#[test]
fn test_signature_rsa_pkcs1_sign() {
let rng = rand::SystemRandom::new();
Ok(())
},
);
-}
+} */
-#[cfg(feature = "alloc")]
+/* #[cfg(feature = "alloc")]
#[test]
fn test_signature_rsa_pss_sign() {
test::run(
Ok(())
},
);
-}
+}*/
// `KeyPair::sign` requires that the output buffer is the same length as
// the public key modulus. Test what happens when it isn't the same length.
}
}
-#[cfg(feature = "alloc")]
+/* #[cfg(feature = "alloc")]
#[test]
fn test_signature_rsa_pkcs1_verify() {
let sha1_params = &[
Ok(())
},
);
-}
+} */
-#[cfg(feature = "alloc")]
+/* #[cfg(feature = "alloc")]
#[test]
fn test_signature_rsa_pss_verify() {
test::run(
Ok(())
},
);
-}
+} */
// Test for `primitive::verify()`. Read public key parts from a file
// and use them to verify a signature.
-#[cfg(feature = "alloc")]
+/* #[cfg(feature = "alloc")]
#[test]
fn test_signature_rsa_primitive_verification() {
test::run(
Ok(())
},
)
-}
+}*/
#[cfg(feature = "alloc")]
#[test]